import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
img=Image.open("/home/gis/gisdata/data/jupyterlabhub/gitcode/cardanger/dataset/newcardata/processing/images/img160320539_79.jpg")
img=np.array(img)
img=cv2.blur(img,(3,3))
out_img =  cv2.Sobel(img, -1, 0,1,7)+cv2.Sobel(img, -1, 1,0,7)
plt.imshow(out_img)
plt.show()

"""
num, labels = cv2.connectedComponents(img)
labels_dict = {i:[] for i in range(1, num+1)}
height, width = img.shape
for h in range(height):
  for w in range(width):
    if labels[h][w] in labels_dict:
      labels_dict[labels[h][w]].append([h,w])

"""



def add(a,b,c):
  return a+b+c

add(1,2,3)